package org.activequant.tradesystem.ib;

import org.activequant.core.domainmodel.marketscanner.ScanCriteria;
import org.activequant.util.ib.IBScanCode;
/**
 * Holds hardcoded ScannerCriteria definitions.
 * Holds the following associated variables:
 * <ul>
 * <li>HIGH_OPT_VOLUME_PUT_CALL_RATIO(ScanCriteria)</li>
 * <li>LOW_OPT_VOLUME_PUT_CALL_RATIO(ScanCriteria)</li>
 * <li>HIGH_VS_13W_HL(ScanCriteria)</li>
 * <li>LOW_VS_13W_HL(ScanCriteria)</li>
 * <li>HIGH_VS_26W_HL(ScanCriteria)</li>
 * <li>LOW_VS_26W_HL(ScanCriteria)</li>
 * <li>HIGH_VS_52W_HL(ScanCriteria)</li>
 * <li>LOW_VS_52W_HL(ScanCriteria)</li>
 * <li>HIGH_OPT_IMP_VOLAT_OVER_HIST(ScanCriteria)</li>
 * <li>LOW_OPT_IMP_VOLAT_OVER_HIST(ScanCriteria)</li>
 * <li>HIGH_OPT_IMP_VOLAT(ScanCriteria)</li>
 * <li>TOP_OPT_IMP_VOLAT_GAIN(ScanCriteria)</li>
 * <li>TOP_OPT_IMP_VOLAT_LOSE(ScanCriteria)</li>
 * <li>OPT_VOLUME_MOST_ACTIVE(ScanCriteria)</li>
 * <li>HOT_BY_OPT_VOLUME(ScanCriteria)</li>
 * <li>HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO(ScanCriteria)</li>
 * <li>LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO(ScanCriteria)</li>
 * <li>TOP_PERC_GAIN(ScanCriteria)</li>
 * <li>MOST_ACTIVE(ScanCriteria)</li>
 * <li>TOP_PERC_LOSE(ScanCriteria)</li>
 * <li>HOT_BY_VOLUME(ScanCriteria)</li>
 * <li>HOT_BY_PRICE(ScanCriteria)</li>
 * <li>TOP_TRADE_COUNT(ScanCriteria)</li>
 * <li>TOP_TRADE_RATE(ScanCriteria)</li>
 * <li>TOP_PRICE_RANGE(ScanCriteria)</li>
 * <li>HOT_BY_PRICE_RANGE(ScanCriteria)</li>
 * <li>TOP_VOLUME_RATE(ScanCriteria)</li>
 * <li>LOW_OPT_IMP_VOLAT(ScanCriteria)</li>
 * <li>OPT_OPEN_INTEREST_MOST_ACTIVE(ScanCriteria)</li>
 * <li>NOT_OPEN(ScanCriteria)</li>
 * <li>HALTED(ScanCriteria)</li>
 * <li>TOP_OPEN_PERC_GAIN(ScanCriteria)</li>
 * <li>TOP_OPEN_PERC_LOSE(ScanCriteria)</li>
 * <li>HIGH_OPEN_GAP(ScanCriteria)</li>
 * <li>LOW_OPEN_GAP(ScanCriteria)</li>
 * <li>HIGH_SYNTH_BID_REV_NAT_YIELD(ScanCriteria)</li>
 * <li>LOW_SYNTH_BID_REV_NAT_YIELD(ScanCriteria)</li>
 * </ul>
 * @author Dimitar
 *
 */
public class ScanCriteriaFactory {
	
	static private ScanCriteriaFactory instance=null;
	
	static ScanCriteriaFactory getInstance(){
		if(instance==null){
			instance=new ScanCriteriaFactory();
		}
		return instance;
	}
	private ScanCriteriaFactory(){
		
	}
	/**
	 * private final static int ROWS_PER_SCAN=50;
	 */
	private final static int ROWS_PER_SCAN=50;
	/**
	 * private final static String LOCATION_CODE="STK.US.MAJOR";
	 */
	private final static String LOCATION_CODE="STK.US.MAJOR";
	/**
	 * private final static double ABOVE_PRICE=30;
	 */
	private final static double ABOVE_PRICE=30;
	/**
	 * private final static double BELOW_PRICE=700;
	 */
	private final static double BELOW_PRICE=700;
	/**
	 * private final static int ABOVE_VOLUME=1000000;
	 */
	private final static int ABOVE_VOLUME=1000000;
	/**
	 * private final static int AVERAGE_OPTION_VOLUME_ABOVE=10000;
	 */
	private final static int AVERAGE_OPTION_VOLUME_ABOVE=10000;
	
	private final static int MARKET_CAP_ABOVE=100000000;
	
	private ScanCriteria HIGH_OPT_VOLUME_PUT_CALL_RATIO=null;
	
	private ScanCriteria LOW_OPT_VOLUME_PUT_CALL_RATIO=null;
	
	private ScanCriteria HIGH_VS_13W_HL=null;
	
	private ScanCriteria LOW_VS_13W_HL=null;
	
	private ScanCriteria HIGH_VS_26W_HL=null;
	
	private ScanCriteria LOW_VS_26W_HL=null;
	
	private ScanCriteria HIGH_VS_52W_HL=null;
	
	private ScanCriteria LOW_VS_52W_HL=null;
	
	private ScanCriteria HIGH_OPT_IMP_VOLAT_OVER_HIST=null;

	private ScanCriteria LOW_OPT_IMP_VOLAT_OVER_HIST=null;
	
	private ScanCriteria HIGH_OPT_IMP_VOLAT=null;
	
	private ScanCriteria TOP_OPT_IMP_VOLAT_GAIN=null;
	
	private ScanCriteria TOP_OPT_IMP_VOLAT_LOSE=null;
	
	private ScanCriteria OPT_VOLUME_MOST_ACTIVE=null;
	
	private ScanCriteria HOT_BY_OPT_VOLUME=null;
	
	private ScanCriteria HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO=null;
	
	private ScanCriteria LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO=null;
	
	private ScanCriteria TOP_PERC_GAIN=null;
		
	private ScanCriteria MOST_ACTIVE=null;
	
	private ScanCriteria TOP_PERC_LOSE=null;
	
	private ScanCriteria HOT_BY_VOLUME=null;
		
	private ScanCriteria HOT_BY_PRICE=null;
	
	private ScanCriteria TOP_TRADE_COUNT=null;
	
	private ScanCriteria TOP_TRADE_RATE=null;
	
	private ScanCriteria TOP_PRICE_RANGE=null;

	private ScanCriteria HOT_BY_PRICE_RANGE=null;
	
	private ScanCriteria TOP_VOLUME_RATE=null;
	
	private ScanCriteria LOW_OPT_IMP_VOLAT=null;
	
	private ScanCriteria OPT_OPEN_INTEREST_MOST_ACTIVE=null;
	
	private ScanCriteria NOT_OPEN=null;
	
	private ScanCriteria HALTED=null;
	
	private ScanCriteria TOP_OPEN_PERC_GAIN=null;
	
	private ScanCriteria TOP_OPEN_PERC_LOSE=null;
	
	private ScanCriteria HIGH_OPEN_GAP=null;
		
	private ScanCriteria LOW_OPEN_GAP=null;
	
	private ScanCriteria HIGH_SYNTH_BID_REV_NAT_YIELD=null;
	
	private ScanCriteria LOW_SYNTH_BID_REV_NAT_YIELD=null;
	
	
	
	/**
	 * this means a bearish underlying (investors think it will go down soon)
	 * @return
	 */
	public ScanCriteria getHIGH_OPT_VOLUME_PUT_CALL_RATIO_Criteria(){
		if(HIGH_OPT_VOLUME_PUT_CALL_RATIO==null){
			HIGH_OPT_VOLUME_PUT_CALL_RATIO=new ScanCriteria();
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setNumberOfRows(ROWS_PER_SCAN);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setVendor("IB");
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setInstrument("STK");
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setLocationCode(LOCATION_CODE);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setScanCode(IBScanCode.HIGH_OPT_VOLUME_PUT_CALL_RATIO.name());
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setAbovePrice(ABOVE_PRICE);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setBelowPrice(BELOW_PRICE);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setAboveVolume(ABOVE_VOLUME);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setMarketCapAbove(MARKET_CAP_ABOVE);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setMarketCapBelow(ScanCriteria.NOT_SET);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setMoodyRatingAbove("");
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setMoodyRatingBelow("");
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setSpRatingAbove("");
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setSpRatingBelow("");
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setMaturityDateAbove(null);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setMaturityDateBelow(null);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setCouponRateAbove(ScanCriteria.NOT_SET);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setCouponRateBelow(ScanCriteria.NOT_SET);
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setExcludeConvertible("0");
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setScannerSettingPairs("Annual,true");
			HIGH_OPT_VOLUME_PUT_CALL_RATIO.setStockTypeFilter("ALL");
		}
		return HIGH_OPT_VOLUME_PUT_CALL_RATIO;
	}
	/**
	 * this means a bullish underlying (investors think it will go up soon)
	 * @return
	 */
	public ScanCriteria getLOW_OPT_VOLUME_PUT_CALL_RATIO_Criteria(){
		if(LOW_OPT_VOLUME_PUT_CALL_RATIO==null){
			LOW_OPT_VOLUME_PUT_CALL_RATIO=new ScanCriteria();
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setNumberOfRows(ROWS_PER_SCAN);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setVendor("IB");
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setInstrument("STK");
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setLocationCode(LOCATION_CODE);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setScanCode(IBScanCode.LOW_OPT_VOLUME_PUT_CALL_RATIO.name());
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setAbovePrice(ABOVE_PRICE);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setBelowPrice(BELOW_PRICE);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setAboveVolume(ABOVE_VOLUME);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setMarketCapAbove(MARKET_CAP_ABOVE);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setMarketCapBelow(ScanCriteria.NOT_SET);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setMoodyRatingAbove("");
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setMoodyRatingBelow("");
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setSpRatingAbove("");
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setSpRatingBelow("");
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setMaturityDateAbove(null);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setMaturityDateBelow(null);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setCouponRateAbove(ScanCriteria.NOT_SET);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setCouponRateBelow(ScanCriteria.NOT_SET);
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setExcludeConvertible("0");
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setScannerSettingPairs("Annual,true");
			LOW_OPT_VOLUME_PUT_CALL_RATIO.setStockTypeFilter("ALL");
		}
		return LOW_OPT_VOLUME_PUT_CALL_RATIO;
	}
	/**
	 * this returns US stocks who trade at the highest price for the past 13 weeks.
	 * @return
	 */
	public ScanCriteria getHIGH_VS_13W_HL_Criteria(){
		if(HIGH_VS_13W_HL==null){
			HIGH_VS_13W_HL=new ScanCriteria();
			HIGH_VS_13W_HL.setNumberOfRows(ROWS_PER_SCAN);
			HIGH_VS_13W_HL.setVendor("IB");
			HIGH_VS_13W_HL.setInstrument("STK");
			HIGH_VS_13W_HL.setLocationCode(LOCATION_CODE);
			HIGH_VS_13W_HL.setScanCode(IBScanCode.HIGH_VS_13W_HL.name());
			HIGH_VS_13W_HL.setAbovePrice(ABOVE_PRICE);
			HIGH_VS_13W_HL.setBelowPrice(BELOW_PRICE);
			HIGH_VS_13W_HL.setAboveVolume(ABOVE_VOLUME);
			HIGH_VS_13W_HL.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HIGH_VS_13W_HL.setMarketCapAbove(MARKET_CAP_ABOVE);
			HIGH_VS_13W_HL.setMarketCapBelow(ScanCriteria.NOT_SET);
			HIGH_VS_13W_HL.setMoodyRatingAbove("");
			HIGH_VS_13W_HL.setMoodyRatingBelow("");
			HIGH_VS_13W_HL.setSpRatingAbove("");
			HIGH_VS_13W_HL.setSpRatingBelow("");
			HIGH_VS_13W_HL.setMaturityDateAbove(null);
			HIGH_VS_13W_HL.setMaturityDateBelow(null);
			HIGH_VS_13W_HL.setCouponRateAbove(ScanCriteria.NOT_SET);
			HIGH_VS_13W_HL.setCouponRateBelow(ScanCriteria.NOT_SET);
			HIGH_VS_13W_HL.setExcludeConvertible("0");
			//HIGH_VS_13W_HL.setScannerSettingPairs("Annual,true");
			HIGH_VS_13W_HL.setStockTypeFilter("ALL");
		}
		return HIGH_VS_13W_HL;
	}
	/**
	 * this returns US stocks who trade at the lowest price for the past 13 weeks.
	 * @return
	 */
	public ScanCriteria getLOW_VS_13W_HL_Criteria(){
		if(LOW_VS_13W_HL==null){
			LOW_VS_13W_HL=new ScanCriteria();
			LOW_VS_13W_HL.setNumberOfRows(ROWS_PER_SCAN);
			LOW_VS_13W_HL.setVendor("IB");
			LOW_VS_13W_HL.setInstrument("STK");
			LOW_VS_13W_HL.setLocationCode(LOCATION_CODE);
			LOW_VS_13W_HL.setScanCode(IBScanCode.LOW_VS_13W_HL.name());
			LOW_VS_13W_HL.setAbovePrice(ABOVE_PRICE);
			LOW_VS_13W_HL.setBelowPrice(BELOW_PRICE);
			LOW_VS_13W_HL.setAboveVolume(ABOVE_VOLUME);
			LOW_VS_13W_HL.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			LOW_VS_13W_HL.setMarketCapAbove(MARKET_CAP_ABOVE);
			LOW_VS_13W_HL.setMarketCapBelow(ScanCriteria.NOT_SET);
			LOW_VS_13W_HL.setMoodyRatingAbove("");
			LOW_VS_13W_HL.setMoodyRatingBelow("");
			LOW_VS_13W_HL.setSpRatingAbove("");
			LOW_VS_13W_HL.setSpRatingBelow("");
			LOW_VS_13W_HL.setMaturityDateAbove(null);
			LOW_VS_13W_HL.setMaturityDateBelow(null);
			LOW_VS_13W_HL.setCouponRateAbove(ScanCriteria.NOT_SET);
			LOW_VS_13W_HL.setCouponRateBelow(ScanCriteria.NOT_SET);
			LOW_VS_13W_HL.setExcludeConvertible("0");
			//LOW_VS_13W_HL.setScannerSettingPairs("Annual,true");
			LOW_VS_13W_HL.setStockTypeFilter("ALL");
		}
		return LOW_VS_13W_HL;
	}
	/**
	 * this returns US stocks who trade at the highest price for the past 26 weeks.
	 * @return
	 */
	public ScanCriteria getHIGH_VS_26W_HL_Criteria(){
		if(HIGH_VS_26W_HL==null){
			HIGH_VS_26W_HL=new ScanCriteria();
			HIGH_VS_26W_HL.setNumberOfRows(ROWS_PER_SCAN);
			HIGH_VS_26W_HL.setVendor("IB");
			HIGH_VS_26W_HL.setInstrument("STK");
			HIGH_VS_26W_HL.setLocationCode(LOCATION_CODE);
			HIGH_VS_26W_HL.setScanCode(IBScanCode.HIGH_VS_26W_HL.name());
			HIGH_VS_26W_HL.setAbovePrice(ABOVE_PRICE);
			HIGH_VS_26W_HL.setBelowPrice(BELOW_PRICE);
			HIGH_VS_26W_HL.setAboveVolume(ABOVE_VOLUME);
			HIGH_VS_26W_HL.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HIGH_VS_26W_HL.setMarketCapAbove(MARKET_CAP_ABOVE);
			HIGH_VS_26W_HL.setMarketCapBelow(ScanCriteria.NOT_SET);
			HIGH_VS_26W_HL.setMoodyRatingAbove("");
			HIGH_VS_26W_HL.setMoodyRatingBelow("");
			HIGH_VS_26W_HL.setSpRatingAbove("");
			HIGH_VS_26W_HL.setSpRatingBelow("");
			HIGH_VS_26W_HL.setMaturityDateAbove(null);
			HIGH_VS_26W_HL.setMaturityDateBelow(null);
			HIGH_VS_26W_HL.setCouponRateAbove(ScanCriteria.NOT_SET);
			HIGH_VS_26W_HL.setCouponRateBelow(ScanCriteria.NOT_SET);
			HIGH_VS_26W_HL.setExcludeConvertible("0");
			//HIGH_VS_26W_HL.setScannerSettingPairs("Annual,true");
			HIGH_VS_26W_HL.setStockTypeFilter("ALL");
		}
		return HIGH_VS_26W_HL;
	}
	/**
	 * this returns US stocks who trade at the lowest price for the past 26 weeks.
	 * @return
	 */
	public ScanCriteria getLOW_VS_26W_HL_Criteria(){
		if(LOW_VS_26W_HL==null){
			LOW_VS_26W_HL=new ScanCriteria();
			LOW_VS_26W_HL.setNumberOfRows(ROWS_PER_SCAN);
			LOW_VS_26W_HL.setVendor("IB");
			LOW_VS_26W_HL.setInstrument("STK");
			LOW_VS_26W_HL.setLocationCode(LOCATION_CODE);
			LOW_VS_26W_HL.setScanCode(IBScanCode.LOW_VS_26W_HL.name());
			LOW_VS_26W_HL.setAbovePrice(ABOVE_PRICE);
			LOW_VS_26W_HL.setBelowPrice(BELOW_PRICE);
			LOW_VS_26W_HL.setAboveVolume(ABOVE_VOLUME);
			LOW_VS_26W_HL.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			LOW_VS_26W_HL.setMarketCapAbove(MARKET_CAP_ABOVE);
			LOW_VS_26W_HL.setMarketCapBelow(ScanCriteria.NOT_SET);
			LOW_VS_26W_HL.setMoodyRatingAbove("");
			LOW_VS_26W_HL.setMoodyRatingBelow("");
			LOW_VS_26W_HL.setSpRatingAbove("");
			LOW_VS_26W_HL.setSpRatingBelow("");
			LOW_VS_26W_HL.setMaturityDateAbove(null);
			LOW_VS_26W_HL.setMaturityDateBelow(null);
			LOW_VS_26W_HL.setCouponRateAbove(ScanCriteria.NOT_SET);
			LOW_VS_26W_HL.setCouponRateBelow(ScanCriteria.NOT_SET);
			LOW_VS_26W_HL.setExcludeConvertible("0");
			//LOW_VS_26W_HL.setScannerSettingPairs("Annual,true");
			LOW_VS_26W_HL.setStockTypeFilter("ALL");
		}
		return LOW_VS_26W_HL;
	}
	/**
	 * this returns US stocks who trade at the highest price for the past 52 weeks.
	 * @return
	 */
	public ScanCriteria getHIGH_VS_52W_HL_Criteria(){
		if(HIGH_VS_52W_HL==null){
			HIGH_VS_52W_HL=new ScanCriteria();
			HIGH_VS_52W_HL.setNumberOfRows(ROWS_PER_SCAN);
			HIGH_VS_52W_HL.setVendor("IB");
			HIGH_VS_52W_HL.setInstrument("STK");
			HIGH_VS_52W_HL.setLocationCode(LOCATION_CODE);
			HIGH_VS_52W_HL.setScanCode(IBScanCode.HIGH_VS_52W_HL.name());
			HIGH_VS_52W_HL.setAbovePrice(ABOVE_PRICE);
			HIGH_VS_52W_HL.setBelowPrice(BELOW_PRICE);
			HIGH_VS_52W_HL.setAboveVolume(ABOVE_VOLUME);
			HIGH_VS_52W_HL.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HIGH_VS_52W_HL.setMarketCapAbove(MARKET_CAP_ABOVE);
			HIGH_VS_52W_HL.setMarketCapBelow(ScanCriteria.NOT_SET);
			HIGH_VS_52W_HL.setMoodyRatingAbove("");
			HIGH_VS_52W_HL.setMoodyRatingBelow("");
			HIGH_VS_52W_HL.setSpRatingAbove("");
			HIGH_VS_52W_HL.setSpRatingBelow("");
			HIGH_VS_52W_HL.setMaturityDateAbove(null);
			HIGH_VS_52W_HL.setMaturityDateBelow(null);
			HIGH_VS_52W_HL.setCouponRateAbove(ScanCriteria.NOT_SET);
			HIGH_VS_52W_HL.setCouponRateBelow(ScanCriteria.NOT_SET);
			HIGH_VS_52W_HL.setExcludeConvertible("0");
			//HIGH_VS_52W_HL.setScannerSettingPairs("Annual,true");
			HIGH_VS_52W_HL.setStockTypeFilter("ALL");
		}
		return HIGH_VS_52W_HL;
	}
	/**
	 * this returns US stocks who trade at the lowest price for the past 52 weeks.
	 * @return
	 */
	public ScanCriteria getLOW_VS_52W_HL_Criteria(){
		if(LOW_VS_52W_HL==null){
			LOW_VS_52W_HL=new ScanCriteria();
			LOW_VS_52W_HL.setNumberOfRows(ROWS_PER_SCAN);
			LOW_VS_52W_HL.setVendor("IB");
			LOW_VS_52W_HL.setInstrument("STK");
			LOW_VS_52W_HL.setLocationCode(LOCATION_CODE);
			LOW_VS_52W_HL.setScanCode(IBScanCode.LOW_VS_52W_HL.name());
			LOW_VS_52W_HL.setAbovePrice(ABOVE_PRICE);
			LOW_VS_52W_HL.setBelowPrice(BELOW_PRICE);
			LOW_VS_52W_HL.setAboveVolume(ABOVE_VOLUME);
			LOW_VS_52W_HL.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			LOW_VS_52W_HL.setMarketCapAbove(MARKET_CAP_ABOVE);
			LOW_VS_52W_HL.setMarketCapBelow(ScanCriteria.NOT_SET);
			LOW_VS_52W_HL.setMoodyRatingAbove("");
			LOW_VS_52W_HL.setMoodyRatingBelow("");
			LOW_VS_52W_HL.setSpRatingAbove("");
			LOW_VS_52W_HL.setSpRatingBelow("");
			LOW_VS_52W_HL.setMaturityDateAbove(null);
			LOW_VS_52W_HL.setMaturityDateBelow(null);
			LOW_VS_52W_HL.setCouponRateAbove(ScanCriteria.NOT_SET);
			LOW_VS_52W_HL.setCouponRateBelow(ScanCriteria.NOT_SET);
			LOW_VS_52W_HL.setExcludeConvertible("0");
			//LOW_VS_52W_HL.setScannerSettingPairs("Annual,true");
			LOW_VS_52W_HL.setStockTypeFilter("ALL");
		}
		return LOW_VS_52W_HL;
	}
	/**
	 * this returns the top underlying contracts (US stocks or indices) with the largest divergence between implied and historical volatilities.
	 * @return
	 */
	public ScanCriteria getHIGH_OPT_IMP_VOLAT_OVER_HIST_Criteria(){
		if(HIGH_OPT_IMP_VOLAT_OVER_HIST==null){
			HIGH_OPT_IMP_VOLAT_OVER_HIST=new ScanCriteria();
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setNumberOfRows(ROWS_PER_SCAN);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setVendor("IB");
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setInstrument("STK");
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setLocationCode(LOCATION_CODE);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setScanCode(IBScanCode.HIGH_OPT_IMP_VOLAT_OVER_HIST.name());
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setAbovePrice(ABOVE_PRICE);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setBelowPrice(BELOW_PRICE);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setAboveVolume(ABOVE_VOLUME);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setMarketCapAbove(MARKET_CAP_ABOVE);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setMarketCapBelow(ScanCriteria.NOT_SET);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setMoodyRatingAbove("");
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setMoodyRatingBelow("");
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setSpRatingAbove("");
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setSpRatingBelow("");
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setMaturityDateAbove(null);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setMaturityDateBelow(null);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setCouponRateAbove(ScanCriteria.NOT_SET);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setCouponRateBelow(ScanCriteria.NOT_SET);
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setExcludeConvertible("0");
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setScannerSettingPairs("Annual,true");
			HIGH_OPT_IMP_VOLAT_OVER_HIST.setStockTypeFilter("ALL");
		}
		return HIGH_OPT_IMP_VOLAT_OVER_HIST;
	}	
	/**
	 * this returns the top underlying contracts (US stocks or indices) with the smallest divergence between implied and historical volatilities.
	 * @return
	 */
	public ScanCriteria getLOW_OPT_IMP_VOLAT_OVER_HIST_Criteria(){
		if(LOW_OPT_IMP_VOLAT_OVER_HIST==null){
			LOW_OPT_IMP_VOLAT_OVER_HIST=new ScanCriteria();
			LOW_OPT_IMP_VOLAT_OVER_HIST.setNumberOfRows(ROWS_PER_SCAN);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setVendor("IB");
			LOW_OPT_IMP_VOLAT_OVER_HIST.setInstrument("STK");
			LOW_OPT_IMP_VOLAT_OVER_HIST.setLocationCode(LOCATION_CODE);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setScanCode(IBScanCode.LOW_OPT_IMP_VOLAT_OVER_HIST.name());
			LOW_OPT_IMP_VOLAT_OVER_HIST.setAbovePrice(ABOVE_PRICE);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setBelowPrice(BELOW_PRICE);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setAboveVolume(ABOVE_VOLUME);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setMarketCapAbove(MARKET_CAP_ABOVE);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setMarketCapBelow(ScanCriteria.NOT_SET);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setMoodyRatingAbove("");
			LOW_OPT_IMP_VOLAT_OVER_HIST.setMoodyRatingBelow("");
			LOW_OPT_IMP_VOLAT_OVER_HIST.setSpRatingAbove("");
			LOW_OPT_IMP_VOLAT_OVER_HIST.setSpRatingBelow("");
			LOW_OPT_IMP_VOLAT_OVER_HIST.setMaturityDateAbove(null);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setMaturityDateBelow(null);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setCouponRateAbove(ScanCriteria.NOT_SET);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setCouponRateBelow(ScanCriteria.NOT_SET);
			LOW_OPT_IMP_VOLAT_OVER_HIST.setExcludeConvertible("0");
			LOW_OPT_IMP_VOLAT_OVER_HIST.setScannerSettingPairs("Annual,true");
			LOW_OPT_IMP_VOLAT_OVER_HIST.setStockTypeFilter("ALL");
		}
		return LOW_OPT_IMP_VOLAT_OVER_HIST;
	}
	/**
	 * this returns the top underlying contracts (stocks or indices) with the highest vega-weighted implied volatility of near-the-money options with an expiration date in the next two months.
	 * @return
	 */
	public ScanCriteria getHIGH_OPT_IMP_VOLAT_Criteria(){
		if(HIGH_OPT_IMP_VOLAT==null){
			HIGH_OPT_IMP_VOLAT=new ScanCriteria();
			HIGH_OPT_IMP_VOLAT.setNumberOfRows(ROWS_PER_SCAN);
			HIGH_OPT_IMP_VOLAT.setVendor("IB");
			HIGH_OPT_IMP_VOLAT.setInstrument("STK");
			HIGH_OPT_IMP_VOLAT.setLocationCode(LOCATION_CODE);
			HIGH_OPT_IMP_VOLAT.setScanCode(IBScanCode.HIGH_OPT_IMP_VOLAT.name());
			HIGH_OPT_IMP_VOLAT.setAbovePrice(ABOVE_PRICE);
			HIGH_OPT_IMP_VOLAT.setBelowPrice(BELOW_PRICE);
			HIGH_OPT_IMP_VOLAT.setAboveVolume(ABOVE_VOLUME);
			HIGH_OPT_IMP_VOLAT.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HIGH_OPT_IMP_VOLAT.setMarketCapAbove(MARKET_CAP_ABOVE);
			HIGH_OPT_IMP_VOLAT.setMarketCapBelow(ScanCriteria.NOT_SET);
			HIGH_OPT_IMP_VOLAT.setMoodyRatingAbove("");
			HIGH_OPT_IMP_VOLAT.setMoodyRatingBelow("");
			HIGH_OPT_IMP_VOLAT.setSpRatingAbove("");
			HIGH_OPT_IMP_VOLAT.setSpRatingBelow("");
			HIGH_OPT_IMP_VOLAT.setMaturityDateAbove(null);
			HIGH_OPT_IMP_VOLAT.setMaturityDateBelow(null);
			HIGH_OPT_IMP_VOLAT.setCouponRateAbove(ScanCriteria.NOT_SET);
			HIGH_OPT_IMP_VOLAT.setCouponRateBelow(ScanCriteria.NOT_SET);
			HIGH_OPT_IMP_VOLAT.setExcludeConvertible("0");
			HIGH_OPT_IMP_VOLAT.setScannerSettingPairs("Annual,true");
			HIGH_OPT_IMP_VOLAT.setStockTypeFilter("ALL");
		}
		return HIGH_OPT_IMP_VOLAT;
	}
	/**
	 * this returns the top underlying contracts (stocks or indices) with the largest percent gain between current implied volatility and yesterday's closing value of the 15 minute average of implied volatility.<br/>
	 * The options markets believe will have the greatest up or down price movement in the future as compared to the past.
	 * @return
	 */
	public ScanCriteria getTOP_OPT_IMP_VOLAT_GAIN_Criteria(){
		if(TOP_OPT_IMP_VOLAT_GAIN==null){
			TOP_OPT_IMP_VOLAT_GAIN=new ScanCriteria();
			TOP_OPT_IMP_VOLAT_GAIN.setNumberOfRows(ROWS_PER_SCAN);
			TOP_OPT_IMP_VOLAT_GAIN.setVendor("IB");
			TOP_OPT_IMP_VOLAT_GAIN.setInstrument("STK");
			TOP_OPT_IMP_VOLAT_GAIN.setLocationCode(LOCATION_CODE);
			TOP_OPT_IMP_VOLAT_GAIN.setScanCode(IBScanCode.TOP_OPT_IMP_VOLAT_GAIN.name());
			TOP_OPT_IMP_VOLAT_GAIN.setAbovePrice(ABOVE_PRICE);
			TOP_OPT_IMP_VOLAT_GAIN.setBelowPrice(BELOW_PRICE);
			TOP_OPT_IMP_VOLAT_GAIN.setAboveVolume(ABOVE_VOLUME);
			TOP_OPT_IMP_VOLAT_GAIN.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_OPT_IMP_VOLAT_GAIN.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_OPT_IMP_VOLAT_GAIN.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_OPT_IMP_VOLAT_GAIN.setMoodyRatingAbove("");
			TOP_OPT_IMP_VOLAT_GAIN.setMoodyRatingBelow("");
			TOP_OPT_IMP_VOLAT_GAIN.setSpRatingAbove("");
			TOP_OPT_IMP_VOLAT_GAIN.setSpRatingBelow("");
			TOP_OPT_IMP_VOLAT_GAIN.setMaturityDateAbove(null);
			TOP_OPT_IMP_VOLAT_GAIN.setMaturityDateBelow(null);
			TOP_OPT_IMP_VOLAT_GAIN.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_OPT_IMP_VOLAT_GAIN.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_OPT_IMP_VOLAT_GAIN.setExcludeConvertible("0");
			TOP_OPT_IMP_VOLAT_GAIN.setScannerSettingPairs("Annual,true");
			TOP_OPT_IMP_VOLAT_GAIN.setStockTypeFilter("ALL");
		}
		return TOP_OPT_IMP_VOLAT_GAIN;
	}
	/**
	 * this returns the top underlying contracts (stocks or indices) with the largest percent loss between current implied volatility and yesterday's closing value of the 15 minute average of implied volatility.
	 */
	public ScanCriteria getTOP_OPT_IMP_VOLAT_LOSE_Criteria(){
		if(TOP_OPT_IMP_VOLAT_LOSE==null){
			TOP_OPT_IMP_VOLAT_LOSE=new ScanCriteria();
			TOP_OPT_IMP_VOLAT_LOSE.setNumberOfRows(ROWS_PER_SCAN);
			TOP_OPT_IMP_VOLAT_LOSE.setVendor("IB");
			TOP_OPT_IMP_VOLAT_LOSE.setInstrument("STK");
			TOP_OPT_IMP_VOLAT_LOSE.setLocationCode(LOCATION_CODE);
			TOP_OPT_IMP_VOLAT_LOSE.setScanCode(IBScanCode.TOP_OPT_IMP_VOLAT_LOSE.name());
			TOP_OPT_IMP_VOLAT_LOSE.setAbovePrice(ABOVE_PRICE);
			TOP_OPT_IMP_VOLAT_LOSE.setBelowPrice(BELOW_PRICE);
			TOP_OPT_IMP_VOLAT_LOSE.setAboveVolume(ABOVE_VOLUME);
			TOP_OPT_IMP_VOLAT_LOSE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_OPT_IMP_VOLAT_LOSE.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_OPT_IMP_VOLAT_LOSE.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_OPT_IMP_VOLAT_LOSE.setMoodyRatingAbove("");
			TOP_OPT_IMP_VOLAT_LOSE.setMoodyRatingBelow("");
			TOP_OPT_IMP_VOLAT_LOSE.setSpRatingAbove("");
			TOP_OPT_IMP_VOLAT_LOSE.setSpRatingBelow("");
			TOP_OPT_IMP_VOLAT_LOSE.setMaturityDateAbove(null);
			TOP_OPT_IMP_VOLAT_LOSE.setMaturityDateBelow(null);
			TOP_OPT_IMP_VOLAT_LOSE.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_OPT_IMP_VOLAT_LOSE.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_OPT_IMP_VOLAT_LOSE.setExcludeConvertible("0");
			TOP_OPT_IMP_VOLAT_LOSE.setScannerSettingPairs("Annual,true");
			TOP_OPT_IMP_VOLAT_LOSE.setStockTypeFilter("ALL");
		}
		return TOP_OPT_IMP_VOLAT_LOSE;
	}
	/**
	 * this returns the most active contracts sorted descending by options volume.
	 * @return
	 */
	public ScanCriteria getOPT_VOLUME_MOST_ACTIVE_Criteria(){
		if(OPT_VOLUME_MOST_ACTIVE==null){
			OPT_VOLUME_MOST_ACTIVE=new ScanCriteria();
			OPT_VOLUME_MOST_ACTIVE.setNumberOfRows(ROWS_PER_SCAN);
			OPT_VOLUME_MOST_ACTIVE.setVendor("IB");
			OPT_VOLUME_MOST_ACTIVE.setInstrument("STK");
			OPT_VOLUME_MOST_ACTIVE.setLocationCode(LOCATION_CODE);
			OPT_VOLUME_MOST_ACTIVE.setScanCode(IBScanCode.OPT_VOLUME_MOST_ACTIVE.name());
			OPT_VOLUME_MOST_ACTIVE.setAbovePrice(ABOVE_PRICE);
			OPT_VOLUME_MOST_ACTIVE.setBelowPrice(BELOW_PRICE);
			OPT_VOLUME_MOST_ACTIVE.setAboveVolume(ABOVE_VOLUME);
			OPT_VOLUME_MOST_ACTIVE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			OPT_VOLUME_MOST_ACTIVE.setMarketCapAbove(MARKET_CAP_ABOVE);
			OPT_VOLUME_MOST_ACTIVE.setMarketCapBelow(ScanCriteria.NOT_SET);
			OPT_VOLUME_MOST_ACTIVE.setMoodyRatingAbove("");
			OPT_VOLUME_MOST_ACTIVE.setMoodyRatingBelow("");
			OPT_VOLUME_MOST_ACTIVE.setSpRatingAbove("");
			OPT_VOLUME_MOST_ACTIVE.setSpRatingBelow("");
			OPT_VOLUME_MOST_ACTIVE.setMaturityDateAbove(null);
			OPT_VOLUME_MOST_ACTIVE.setMaturityDateBelow(null);
			OPT_VOLUME_MOST_ACTIVE.setCouponRateAbove(ScanCriteria.NOT_SET);
			OPT_VOLUME_MOST_ACTIVE.setCouponRateBelow(ScanCriteria.NOT_SET);
			OPT_VOLUME_MOST_ACTIVE.setExcludeConvertible("0");
			OPT_VOLUME_MOST_ACTIVE.setScannerSettingPairs("Annual,true");
			OPT_VOLUME_MOST_ACTIVE.setStockTypeFilter("ALL");
		}
		return OPT_VOLUME_MOST_ACTIVE;
	}
	/**
	 * this returns the top underlying contracts for highest options volume over a 10-day average.
	 * @return
	 */
	public ScanCriteria getHOT_BY_OPT_VOLUME_Criteria(){
		if(HOT_BY_OPT_VOLUME==null){
			HOT_BY_OPT_VOLUME=new ScanCriteria();
			HOT_BY_OPT_VOLUME.setNumberOfRows(ROWS_PER_SCAN);
			HOT_BY_OPT_VOLUME.setVendor("IB");
			HOT_BY_OPT_VOLUME.setInstrument("STK");
			HOT_BY_OPT_VOLUME.setLocationCode(LOCATION_CODE);
			HOT_BY_OPT_VOLUME.setScanCode(IBScanCode.HOT_BY_OPT_VOLUME.name());
			HOT_BY_OPT_VOLUME.setAbovePrice(ABOVE_PRICE);
			HOT_BY_OPT_VOLUME.setBelowPrice(BELOW_PRICE);
			HOT_BY_OPT_VOLUME.setAboveVolume(ABOVE_VOLUME);
			HOT_BY_OPT_VOLUME.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HOT_BY_OPT_VOLUME.setMarketCapAbove(MARKET_CAP_ABOVE);
			HOT_BY_OPT_VOLUME.setMarketCapBelow(ScanCriteria.NOT_SET);
			HOT_BY_OPT_VOLUME.setMoodyRatingAbove("");
			HOT_BY_OPT_VOLUME.setMoodyRatingBelow("");
			HOT_BY_OPT_VOLUME.setSpRatingAbove("");
			HOT_BY_OPT_VOLUME.setSpRatingBelow("");
			HOT_BY_OPT_VOLUME.setMaturityDateAbove(null);
			HOT_BY_OPT_VOLUME.setMaturityDateBelow(null);
			HOT_BY_OPT_VOLUME.setCouponRateAbove(ScanCriteria.NOT_SET);
			HOT_BY_OPT_VOLUME.setCouponRateBelow(ScanCriteria.NOT_SET);
			HOT_BY_OPT_VOLUME.setExcludeConvertible("0");
			HOT_BY_OPT_VOLUME.setScannerSettingPairs("Annual,true");
			HOT_BY_OPT_VOLUME.setStockTypeFilter("ALL");
		}
		return HOT_BY_OPT_VOLUME;
	}
	/**
	 * this returns the top 50 contracts with the highest put/call ratio of outstanding option contracts.
	 * @return
	 */
	public ScanCriteria getHIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO_Criteria(){
		if(HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO==null){
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO=new ScanCriteria();
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setNumberOfRows(ROWS_PER_SCAN);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setVendor("IB");
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setInstrument("STK");
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setLocationCode(LOCATION_CODE);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setScanCode(IBScanCode.HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.name());
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setAbovePrice(ABOVE_PRICE);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setBelowPrice(BELOW_PRICE);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setAboveVolume(ABOVE_VOLUME);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMarketCapAbove(MARKET_CAP_ABOVE);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMarketCapBelow(ScanCriteria.NOT_SET);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMoodyRatingAbove("");
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMoodyRatingBelow("");
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setSpRatingAbove("");
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setSpRatingBelow("");
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMaturityDateAbove(null);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMaturityDateBelow(null);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setCouponRateAbove(ScanCriteria.NOT_SET);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setCouponRateBelow(ScanCriteria.NOT_SET);
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setExcludeConvertible("0");
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setScannerSettingPairs("Annual,true");
			HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setStockTypeFilter("ALL");
		}
		return HIGH_OPT_OPEN_INTEREST_PUT_CALL_RATIO;
	}
	/**
	 * this returns the top 50 contracts with the lowest put/call ratio of outstanding option contracts.
	 * @return
	 */
	public ScanCriteria getLOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO_Criteria(){
		if(LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO==null){
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO=new ScanCriteria();
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setNumberOfRows(ROWS_PER_SCAN);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setVendor("IB");
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setInstrument("STK");
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setLocationCode(LOCATION_CODE);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setScanCode(IBScanCode.LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.name());
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setAbovePrice(ABOVE_PRICE);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setBelowPrice(BELOW_PRICE);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setAboveVolume(ABOVE_VOLUME);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMarketCapAbove(MARKET_CAP_ABOVE);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMarketCapBelow(ScanCriteria.NOT_SET);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMoodyRatingAbove("");
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMoodyRatingBelow("");
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setSpRatingAbove("");
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setSpRatingBelow("");
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMaturityDateAbove(null);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setMaturityDateBelow(null);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setCouponRateAbove(ScanCriteria.NOT_SET);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setCouponRateBelow(ScanCriteria.NOT_SET);
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setExcludeConvertible("0");
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setScannerSettingPairs("Annual,true");
			LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO.setStockTypeFilter("ALL");
		}
		return LOW_OPT_OPEN_INTEREST_PUT_CALL_RATIO;
	}
	/**
	 * this returns contracts whose last trade price shows the highest percent increase from the previous night's closing price.
	 * @return
	 */
	public ScanCriteria getTOP_PERC_GAIN_Criteria(){
		if(TOP_PERC_GAIN==null){
			TOP_PERC_GAIN=new ScanCriteria();
			TOP_PERC_GAIN.setNumberOfRows(ROWS_PER_SCAN);
			TOP_PERC_GAIN.setVendor("IB");
			TOP_PERC_GAIN.setInstrument("STK");
			TOP_PERC_GAIN.setLocationCode(LOCATION_CODE);
			TOP_PERC_GAIN.setScanCode(IBScanCode.TOP_PERC_GAIN.name());
			TOP_PERC_GAIN.setAbovePrice(ABOVE_PRICE);
			TOP_PERC_GAIN.setBelowPrice(BELOW_PRICE);
			TOP_PERC_GAIN.setAboveVolume(ABOVE_VOLUME);
			TOP_PERC_GAIN.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_PERC_GAIN.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_PERC_GAIN.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_PERC_GAIN.setMoodyRatingAbove("");
			TOP_PERC_GAIN.setMoodyRatingBelow("");
			TOP_PERC_GAIN.setSpRatingAbove("");
			TOP_PERC_GAIN.setSpRatingBelow("");
			TOP_PERC_GAIN.setMaturityDateAbove(null);
			TOP_PERC_GAIN.setMaturityDateBelow(null);
			TOP_PERC_GAIN.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_PERC_GAIN.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_PERC_GAIN.setExcludeConvertible("0");
			TOP_PERC_GAIN.setScannerSettingPairs("Annual,true");
			TOP_PERC_GAIN.setStockTypeFilter("ALL");
		}
		return TOP_PERC_GAIN;
	}
	/**
	 * this returns contracts with the highest trading volume today, based on units used by TWS (lots for US stocks; contract for derivatives and non-US stocks).
	 * @return
	 */
	public ScanCriteria getMOST_ACTIVE_Criteria(){
		if(MOST_ACTIVE==null){
			MOST_ACTIVE=new ScanCriteria();
			MOST_ACTIVE.setNumberOfRows(ROWS_PER_SCAN);
			MOST_ACTIVE.setVendor("IB");
			MOST_ACTIVE.setInstrument("STK");
			MOST_ACTIVE.setLocationCode(LOCATION_CODE);
			MOST_ACTIVE.setScanCode(IBScanCode.MOST_ACTIVE.name());
			MOST_ACTIVE.setAbovePrice(ABOVE_PRICE);
			MOST_ACTIVE.setBelowPrice(BELOW_PRICE);
			MOST_ACTIVE.setAboveVolume(ABOVE_VOLUME);
			MOST_ACTIVE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			MOST_ACTIVE.setMarketCapAbove(MARKET_CAP_ABOVE);
			MOST_ACTIVE.setMarketCapBelow(ScanCriteria.NOT_SET);
			MOST_ACTIVE.setMoodyRatingAbove("");
			MOST_ACTIVE.setMoodyRatingBelow("");
			MOST_ACTIVE.setSpRatingAbove("");
			MOST_ACTIVE.setSpRatingBelow("");
			MOST_ACTIVE.setMaturityDateAbove(null);
			MOST_ACTIVE.setMaturityDateBelow(null);
			MOST_ACTIVE.setCouponRateAbove(ScanCriteria.NOT_SET);
			MOST_ACTIVE.setCouponRateBelow(ScanCriteria.NOT_SET);
			MOST_ACTIVE.setExcludeConvertible("0");
			MOST_ACTIVE.setScannerSettingPairs("Annual,true");
			MOST_ACTIVE.setStockTypeFilter("ALL");
		}
		return MOST_ACTIVE;
	}
	/**
	 * this returns contracts whose last trade price shows the lowest percent increase from the previous night's closing price.
	 * @return
	 */
	public ScanCriteria getTOP_PERC_LOSE_Criteria(){
		if(TOP_PERC_LOSE==null){
			TOP_PERC_LOSE=new ScanCriteria();
			TOP_PERC_LOSE.setNumberOfRows(ROWS_PER_SCAN);
			TOP_PERC_LOSE.setVendor("IB");
			TOP_PERC_LOSE.setInstrument("STK");
			TOP_PERC_LOSE.setLocationCode(LOCATION_CODE);
			TOP_PERC_LOSE.setScanCode(IBScanCode.TOP_PERC_LOSE.name());
			TOP_PERC_LOSE.setAbovePrice(ABOVE_PRICE);
			TOP_PERC_LOSE.setBelowPrice(BELOW_PRICE);
			TOP_PERC_LOSE.setAboveVolume(ABOVE_VOLUME);
			TOP_PERC_LOSE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_PERC_LOSE.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_PERC_LOSE.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_PERC_LOSE.setMoodyRatingAbove("");
			TOP_PERC_LOSE.setMoodyRatingBelow("");
			TOP_PERC_LOSE.setSpRatingAbove("");
			TOP_PERC_LOSE.setSpRatingBelow("");
			TOP_PERC_LOSE.setMaturityDateAbove(null);
			TOP_PERC_LOSE.setMaturityDateBelow(null);
			TOP_PERC_LOSE.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_PERC_LOSE.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_PERC_LOSE.setExcludeConvertible("0");
			TOP_PERC_LOSE.setScannerSettingPairs("Annual,true");
			TOP_PERC_LOSE.setStockTypeFilter("ALL");
		}
		return TOP_PERC_LOSE;
	}
	/**
	 * this returns contracts where: today's Volume/avgDailyVolume is highest. avgDailyVolume is a 30-day exponential moving average of the contract's daily volume.
	 * @return
	 */
	public ScanCriteria getHOT_BY_VOLUME_Criteria(){
		if(HOT_BY_VOLUME==null){
			HOT_BY_VOLUME=new ScanCriteria();
			HOT_BY_VOLUME.setNumberOfRows(ROWS_PER_SCAN);
			HOT_BY_VOLUME.setVendor("IB");
			HOT_BY_VOLUME.setInstrument("STK");
			HOT_BY_VOLUME.setLocationCode(LOCATION_CODE);
			HOT_BY_VOLUME.setScanCode(IBScanCode.HOT_BY_VOLUME.name());
			HOT_BY_VOLUME.setAbovePrice(ABOVE_PRICE);
			HOT_BY_VOLUME.setBelowPrice(BELOW_PRICE);
			HOT_BY_VOLUME.setAboveVolume(ABOVE_VOLUME);
			HOT_BY_VOLUME.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HOT_BY_VOLUME.setMarketCapAbove(MARKET_CAP_ABOVE);
			HOT_BY_VOLUME.setMarketCapBelow(ScanCriteria.NOT_SET);
			HOT_BY_VOLUME.setMoodyRatingAbove("");
			HOT_BY_VOLUME.setMoodyRatingBelow("");
			HOT_BY_VOLUME.setSpRatingAbove("");
			HOT_BY_VOLUME.setSpRatingBelow("");
			HOT_BY_VOLUME.setMaturityDateAbove(null);
			HOT_BY_VOLUME.setMaturityDateBelow(null);
			HOT_BY_VOLUME.setCouponRateAbove(ScanCriteria.NOT_SET);
			HOT_BY_VOLUME.setCouponRateBelow(ScanCriteria.NOT_SET);
			HOT_BY_VOLUME.setExcludeConvertible("0");
			HOT_BY_VOLUME.setScannerSettingPairs("Annual,true");
			HOT_BY_VOLUME.setStockTypeFilter("ALL");
		}
		return HOT_BY_VOLUME;
	}
	/**
	 * this returns contracts where: (lastTradePrice-prevClose)/avgDailyChange is highest in absolute value (positive or negative). The avgDailyChange is defined as an exponential moving average of the contract's (dailyClose-dailyOpen).
	 * @return
	 */
	public ScanCriteria getHOT_BY_PRICE_Criteria(){
		if(HOT_BY_PRICE==null){
			HOT_BY_PRICE=new ScanCriteria();
			HOT_BY_PRICE.setNumberOfRows(ROWS_PER_SCAN);
			HOT_BY_PRICE.setVendor("IB");
			HOT_BY_PRICE.setInstrument("STK");
			HOT_BY_PRICE.setLocationCode(LOCATION_CODE);
			HOT_BY_PRICE.setScanCode(IBScanCode.HOT_BY_PRICE.name());
			HOT_BY_PRICE.setAbovePrice(ABOVE_PRICE);
			HOT_BY_PRICE.setBelowPrice(BELOW_PRICE);
			HOT_BY_PRICE.setAboveVolume(ABOVE_VOLUME);
			HOT_BY_PRICE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HOT_BY_PRICE.setMarketCapAbove(MARKET_CAP_ABOVE);
			HOT_BY_PRICE.setMarketCapBelow(ScanCriteria.NOT_SET);
			HOT_BY_PRICE.setMoodyRatingAbove("");
			HOT_BY_PRICE.setMoodyRatingBelow("");
			HOT_BY_PRICE.setSpRatingAbove("");
			HOT_BY_PRICE.setSpRatingBelow("");
			HOT_BY_PRICE.setMaturityDateAbove(null);
			HOT_BY_PRICE.setMaturityDateBelow(null);
			HOT_BY_PRICE.setCouponRateAbove(ScanCriteria.NOT_SET);
			HOT_BY_PRICE.setCouponRateBelow(ScanCriteria.NOT_SET);
			HOT_BY_PRICE.setExcludeConvertible("0");
			HOT_BY_PRICE.setScannerSettingPairs("Annual,true");
			HOT_BY_PRICE.setStockTypeFilter("ALL");
		}
		return HOT_BY_PRICE;
	}
	/**
	 * The top trade count during the day.
	 * @return
	 */
	public ScanCriteria getTOP_TRADE_COUNT_Criteria(){
		if(TOP_TRADE_COUNT==null){
			TOP_TRADE_COUNT=new ScanCriteria();
			TOP_TRADE_COUNT.setNumberOfRows(ROWS_PER_SCAN);
			TOP_TRADE_COUNT.setVendor("IB");
			TOP_TRADE_COUNT.setInstrument("STK");
			TOP_TRADE_COUNT.setLocationCode(LOCATION_CODE);
			TOP_TRADE_COUNT.setScanCode(IBScanCode.TOP_TRADE_COUNT.name());
			TOP_TRADE_COUNT.setAbovePrice(ABOVE_PRICE);
			TOP_TRADE_COUNT.setBelowPrice(BELOW_PRICE);
			TOP_TRADE_COUNT.setAboveVolume(ABOVE_VOLUME);
			TOP_TRADE_COUNT.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_TRADE_COUNT.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_TRADE_COUNT.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_TRADE_COUNT.setMoodyRatingAbove("");
			TOP_TRADE_COUNT.setMoodyRatingBelow("");
			TOP_TRADE_COUNT.setSpRatingAbove("");
			TOP_TRADE_COUNT.setSpRatingBelow("");
			TOP_TRADE_COUNT.setMaturityDateAbove(null);
			TOP_TRADE_COUNT.setMaturityDateBelow(null);
			TOP_TRADE_COUNT.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_TRADE_COUNT.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_TRADE_COUNT.setExcludeConvertible("0");
			TOP_TRADE_COUNT.setScannerSettingPairs("Annual,true");
			TOP_TRADE_COUNT.setStockTypeFilter("ALL");
		}
		return TOP_TRADE_COUNT;
	}
	/**
	 * this returns contracts with the highest number of trades in the past 60 seconds (regardless of the sizes of those trades).
	 * @return
	 */
	public ScanCriteria getTOP_TRADE_RATE_Criteria(){
		if(TOP_TRADE_RATE==null){
			TOP_TRADE_RATE=new ScanCriteria();
			TOP_TRADE_RATE.setNumberOfRows(ROWS_PER_SCAN);
			TOP_TRADE_RATE.setVendor("IB");
			TOP_TRADE_RATE.setInstrument("STK");
			TOP_TRADE_RATE.setLocationCode(LOCATION_CODE);
			TOP_TRADE_RATE.setScanCode(IBScanCode.TOP_TRADE_RATE.name());
			TOP_TRADE_RATE.setAbovePrice(ABOVE_PRICE);
			TOP_TRADE_RATE.setBelowPrice(BELOW_PRICE);
			TOP_TRADE_RATE.setAboveVolume(ABOVE_VOLUME);
			TOP_TRADE_RATE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_TRADE_RATE.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_TRADE_RATE.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_TRADE_RATE.setMoodyRatingAbove("");
			TOP_TRADE_RATE.setMoodyRatingBelow("");
			TOP_TRADE_RATE.setSpRatingAbove("");
			TOP_TRADE_RATE.setSpRatingBelow("");
			TOP_TRADE_RATE.setMaturityDateAbove(null);
			TOP_TRADE_RATE.setMaturityDateBelow(null);
			TOP_TRADE_RATE.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_TRADE_RATE.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_TRADE_RATE.setExcludeConvertible("0");
			TOP_TRADE_RATE.setScannerSettingPairs("Annual,true");
			TOP_TRADE_RATE.setStockTypeFilter("ALL");
		}
		return TOP_TRADE_RATE;
	}
	/**
	 * this returns contracts with the largest difference between today's high and low, or yesterday's close if outside of today's range.
	 * @return
	 */
	public ScanCriteria getTOP_PRICE_RANGE_Criteria(){
		if(TOP_PRICE_RANGE==null){
			TOP_PRICE_RANGE=new ScanCriteria();
			TOP_PRICE_RANGE.setNumberOfRows(ROWS_PER_SCAN);
			TOP_PRICE_RANGE.setVendor("IB");
			TOP_PRICE_RANGE.setInstrument("STK");
			TOP_PRICE_RANGE.setLocationCode(LOCATION_CODE);
			TOP_PRICE_RANGE.setScanCode(IBScanCode.TOP_PRICE_RANGE.name());
			TOP_PRICE_RANGE.setAbovePrice(ABOVE_PRICE);
			TOP_PRICE_RANGE.setBelowPrice(BELOW_PRICE);
			TOP_PRICE_RANGE.setAboveVolume(ABOVE_VOLUME);
			TOP_PRICE_RANGE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_PRICE_RANGE.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_PRICE_RANGE.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_PRICE_RANGE.setMoodyRatingAbove("");
			TOP_PRICE_RANGE.setMoodyRatingBelow("");
			TOP_PRICE_RANGE.setSpRatingAbove("");
			TOP_PRICE_RANGE.setSpRatingBelow("");
			TOP_PRICE_RANGE.setMaturityDateAbove(null);
			TOP_PRICE_RANGE.setMaturityDateBelow(null);
			TOP_PRICE_RANGE.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_PRICE_RANGE.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_PRICE_RANGE.setExcludeConvertible("0");
			TOP_PRICE_RANGE.setScannerSettingPairs("Annual,true");
			TOP_PRICE_RANGE.setStockTypeFilter("ALL");
		}
		return TOP_PRICE_RANGE;
	}
	
//fix description	
	/**
	 * this returns contracts with the largest price range (from Top Price Range calculation) over the volatility.
	 * @return
	 */
	public ScanCriteria getHOT_BY_PRICE_RANGE_Criteria(){
		if(HOT_BY_PRICE_RANGE==null){
			HOT_BY_PRICE_RANGE=new ScanCriteria();
			HOT_BY_PRICE_RANGE.setNumberOfRows(ROWS_PER_SCAN);
			HOT_BY_PRICE_RANGE.setVendor("IB");
			HOT_BY_PRICE_RANGE.setInstrument("STK");
			HOT_BY_PRICE_RANGE.setLocationCode(LOCATION_CODE);
			HOT_BY_PRICE_RANGE.setScanCode(IBScanCode.HOT_BY_PRICE_RANGE.name());
			HOT_BY_PRICE_RANGE.setAbovePrice(ABOVE_PRICE);
			HOT_BY_PRICE_RANGE.setBelowPrice(BELOW_PRICE);
			HOT_BY_PRICE_RANGE.setAboveVolume(ABOVE_VOLUME);
			HOT_BY_PRICE_RANGE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HOT_BY_PRICE_RANGE.setMarketCapAbove(MARKET_CAP_ABOVE);
			HOT_BY_PRICE_RANGE.setMarketCapBelow(ScanCriteria.NOT_SET);
			HOT_BY_PRICE_RANGE.setMoodyRatingAbove("");
			HOT_BY_PRICE_RANGE.setMoodyRatingBelow("");
			HOT_BY_PRICE_RANGE.setSpRatingAbove("");
			HOT_BY_PRICE_RANGE.setSpRatingBelow("");
			HOT_BY_PRICE_RANGE.setMaturityDateAbove(null);
			HOT_BY_PRICE_RANGE.setMaturityDateBelow(null);
			HOT_BY_PRICE_RANGE.setCouponRateAbove(ScanCriteria.NOT_SET);
			HOT_BY_PRICE_RANGE.setCouponRateBelow(ScanCriteria.NOT_SET);
			HOT_BY_PRICE_RANGE.setExcludeConvertible("0");
			HOT_BY_PRICE_RANGE.setScannerSettingPairs("Annual,true");
			HOT_BY_PRICE_RANGE.setStockTypeFilter("ALL");
		}
		return HOT_BY_PRICE_RANGE;
	}
	/**
	 * this returns contracts with the top volume rate per minute.
	 * @return
	 */
	public ScanCriteria getTOP_VOLUME_RATE_Criteria(){
		if(TOP_VOLUME_RATE==null){
			TOP_VOLUME_RATE=new ScanCriteria();
			TOP_VOLUME_RATE.setNumberOfRows(ROWS_PER_SCAN);
			TOP_VOLUME_RATE.setVendor("IB");
			TOP_VOLUME_RATE.setInstrument("STK");
			TOP_VOLUME_RATE.setLocationCode(LOCATION_CODE);
			TOP_VOLUME_RATE.setScanCode(IBScanCode.TOP_VOLUME_RATE.name());
			TOP_VOLUME_RATE.setAbovePrice(ABOVE_PRICE);
			TOP_VOLUME_RATE.setBelowPrice(BELOW_PRICE);
			TOP_VOLUME_RATE.setAboveVolume(ABOVE_VOLUME);
			TOP_VOLUME_RATE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_VOLUME_RATE.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_VOLUME_RATE.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_VOLUME_RATE.setMoodyRatingAbove("");
			TOP_VOLUME_RATE.setMoodyRatingBelow("");
			TOP_VOLUME_RATE.setSpRatingAbove("");
			TOP_VOLUME_RATE.setSpRatingBelow("");
			TOP_VOLUME_RATE.setMaturityDateAbove(null);
			TOP_VOLUME_RATE.setMaturityDateBelow(null);
			TOP_VOLUME_RATE.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_VOLUME_RATE.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_VOLUME_RATE.setExcludeConvertible("0");
			TOP_VOLUME_RATE.setScannerSettingPairs("Annual,true");
			TOP_VOLUME_RATE.setStockTypeFilter("ALL");
		}
		return TOP_VOLUME_RATE;
	}
	/**
	 * this returns the top underlying contracts (stocks or indices) with the lowest vega-weighted implied volatility of near-the-money options with an expiration date in the next two months.
	 * @return
	 */
	public ScanCriteria getLOW_OPT_IMP_VOLAT_Criteria(){
		if(LOW_OPT_IMP_VOLAT==null){
			LOW_OPT_IMP_VOLAT=new ScanCriteria();
			LOW_OPT_IMP_VOLAT.setNumberOfRows(ROWS_PER_SCAN);
			LOW_OPT_IMP_VOLAT.setVendor("IB");
			LOW_OPT_IMP_VOLAT.setInstrument("STK");
			LOW_OPT_IMP_VOLAT.setLocationCode(LOCATION_CODE);
			LOW_OPT_IMP_VOLAT.setScanCode(IBScanCode.LOW_OPT_IMP_VOLAT.name());
			LOW_OPT_IMP_VOLAT.setAbovePrice(ABOVE_PRICE);
			LOW_OPT_IMP_VOLAT.setBelowPrice(BELOW_PRICE);
			LOW_OPT_IMP_VOLAT.setAboveVolume(ABOVE_VOLUME);
			LOW_OPT_IMP_VOLAT.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			LOW_OPT_IMP_VOLAT.setMarketCapAbove(MARKET_CAP_ABOVE);
			LOW_OPT_IMP_VOLAT.setMarketCapBelow(ScanCriteria.NOT_SET);
			LOW_OPT_IMP_VOLAT.setMoodyRatingAbove("");
			LOW_OPT_IMP_VOLAT.setMoodyRatingBelow("");
			LOW_OPT_IMP_VOLAT.setSpRatingAbove("");
			LOW_OPT_IMP_VOLAT.setSpRatingBelow("");
			LOW_OPT_IMP_VOLAT.setMaturityDateAbove(null);
			LOW_OPT_IMP_VOLAT.setMaturityDateBelow(null);
			LOW_OPT_IMP_VOLAT.setCouponRateAbove(ScanCriteria.NOT_SET);
			LOW_OPT_IMP_VOLAT.setCouponRateBelow(ScanCriteria.NOT_SET);
			LOW_OPT_IMP_VOLAT.setExcludeConvertible("0");
			LOW_OPT_IMP_VOLAT.setScannerSettingPairs("Annual,true");
			LOW_OPT_IMP_VOLAT.setStockTypeFilter("ALL");
		}
		return LOW_OPT_IMP_VOLAT;
	}
	/**
	 * this returns the top 50 underlying contracts with the (highest number of outstanding call contracts) + (highest number of outstanding put contracts)
	 * @return
	 */
	public ScanCriteria getOPT_OPEN_INTEREST_MOST_ACTIVE_Criteria(){
		if(OPT_OPEN_INTEREST_MOST_ACTIVE==null){
			OPT_OPEN_INTEREST_MOST_ACTIVE=new ScanCriteria();
			OPT_OPEN_INTEREST_MOST_ACTIVE.setNumberOfRows(ROWS_PER_SCAN);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setVendor("IB");
			OPT_OPEN_INTEREST_MOST_ACTIVE.setInstrument("STK");
			OPT_OPEN_INTEREST_MOST_ACTIVE.setLocationCode(LOCATION_CODE);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setScanCode(IBScanCode.OPT_OPEN_INTEREST_MOST_ACTIVE.name());
			OPT_OPEN_INTEREST_MOST_ACTIVE.setAbovePrice(ABOVE_PRICE);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setBelowPrice(BELOW_PRICE);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setAboveVolume(ABOVE_VOLUME);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setMarketCapAbove(MARKET_CAP_ABOVE);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setMarketCapBelow(ScanCriteria.NOT_SET);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setMoodyRatingAbove("");
			OPT_OPEN_INTEREST_MOST_ACTIVE.setMoodyRatingBelow("");
			OPT_OPEN_INTEREST_MOST_ACTIVE.setSpRatingAbove("");
			OPT_OPEN_INTEREST_MOST_ACTIVE.setSpRatingBelow("");
			OPT_OPEN_INTEREST_MOST_ACTIVE.setMaturityDateAbove(null);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setMaturityDateBelow(null);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setCouponRateAbove(ScanCriteria.NOT_SET);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setCouponRateBelow(ScanCriteria.NOT_SET);
			OPT_OPEN_INTEREST_MOST_ACTIVE.setExcludeConvertible("0");
			OPT_OPEN_INTEREST_MOST_ACTIVE.setScannerSettingPairs("Annual,true");
			OPT_OPEN_INTEREST_MOST_ACTIVE.setStockTypeFilter("ALL");
		}
		return OPT_OPEN_INTEREST_MOST_ACTIVE;
	}
	/**
	 * this returns contracts that have not traded today.
	 * @return
	 */
	public ScanCriteria getNOT_OPEN_Criteria(){
		if(NOT_OPEN==null){
			NOT_OPEN=new ScanCriteria();
			NOT_OPEN.setNumberOfRows(ROWS_PER_SCAN);
			NOT_OPEN.setVendor("IB");
			NOT_OPEN.setInstrument("STK");
			NOT_OPEN.setLocationCode(LOCATION_CODE);
			NOT_OPEN.setScanCode(IBScanCode.NOT_OPEN.name());
			NOT_OPEN.setAbovePrice(ABOVE_PRICE);
			NOT_OPEN.setBelowPrice(BELOW_PRICE);
			NOT_OPEN.setAboveVolume(ABOVE_VOLUME);
			NOT_OPEN.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			NOT_OPEN.setMarketCapAbove(MARKET_CAP_ABOVE);
			NOT_OPEN.setMarketCapBelow(ScanCriteria.NOT_SET);
			NOT_OPEN.setMoodyRatingAbove("");
			NOT_OPEN.setMoodyRatingBelow("");
			NOT_OPEN.setSpRatingAbove("");
			NOT_OPEN.setSpRatingBelow("");
			NOT_OPEN.setMaturityDateAbove(null);
			NOT_OPEN.setMaturityDateBelow(null);
			NOT_OPEN.setCouponRateAbove(ScanCriteria.NOT_SET);
			NOT_OPEN.setCouponRateBelow(ScanCriteria.NOT_SET);
			NOT_OPEN.setExcludeConvertible("0");
			NOT_OPEN.setScannerSettingPairs("Annual,true");
			NOT_OPEN.setStockTypeFilter("ALL");
		}
		return NOT_OPEN;
	}
	/**
	 * this returns contracts for which trading has been halted.
	 * @return
	 */
	public ScanCriteria getHALTED_Criteria(){
		if(HALTED==null){
			HALTED=new ScanCriteria();
			HALTED.setNumberOfRows(ROWS_PER_SCAN);
			HALTED.setVendor("IB");
			HALTED.setInstrument("STK");
			HALTED.setLocationCode(LOCATION_CODE);
			HALTED.setScanCode(IBScanCode.HALTED.name());
			HALTED.setAbovePrice(ABOVE_PRICE);
			HALTED.setBelowPrice(BELOW_PRICE);
			HALTED.setAboveVolume(ABOVE_VOLUME);
			HALTED.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HALTED.setMarketCapAbove(MARKET_CAP_ABOVE);
			HALTED.setMarketCapBelow(ScanCriteria.NOT_SET);
			HALTED.setMoodyRatingAbove("");
			HALTED.setMoodyRatingBelow("");
			HALTED.setSpRatingAbove("");
			HALTED.setSpRatingBelow("");
			HALTED.setMaturityDateAbove(null);
			HALTED.setMaturityDateBelow(null);
			HALTED.setCouponRateAbove(ScanCriteria.NOT_SET);
			HALTED.setCouponRateBelow(ScanCriteria.NOT_SET);
			HALTED.setExcludeConvertible("0");
			HALTED.setScannerSettingPairs("Annual,true");
			HALTED.setStockTypeFilter("ALL");
		}
		return HALTED;
	}
	/**
	 * this returns contracts with the highest percent price INCREASE between the last trade and opening prices.
	 * @return
	 */
	public ScanCriteria getTOP_OPEN_PERC_GAIN_Criteria(){
		if(TOP_OPEN_PERC_GAIN==null){
			TOP_OPEN_PERC_GAIN=new ScanCriteria();
			TOP_OPEN_PERC_GAIN.setNumberOfRows(ROWS_PER_SCAN);
			TOP_OPEN_PERC_GAIN.setVendor("IB");
			TOP_OPEN_PERC_GAIN.setInstrument("STK");
			TOP_OPEN_PERC_GAIN.setLocationCode(LOCATION_CODE);
			TOP_OPEN_PERC_GAIN.setScanCode(IBScanCode.TOP_OPEN_PERC_GAIN.name());
			TOP_OPEN_PERC_GAIN.setAbovePrice(ABOVE_PRICE);
			TOP_OPEN_PERC_GAIN.setBelowPrice(BELOW_PRICE);
			TOP_OPEN_PERC_GAIN.setAboveVolume(ABOVE_VOLUME);
			TOP_OPEN_PERC_GAIN.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_OPEN_PERC_GAIN.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_OPEN_PERC_GAIN.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_OPEN_PERC_GAIN.setMoodyRatingAbove("");
			TOP_OPEN_PERC_GAIN.setMoodyRatingBelow("");
			TOP_OPEN_PERC_GAIN.setSpRatingAbove("");
			TOP_OPEN_PERC_GAIN.setSpRatingBelow("");
			TOP_OPEN_PERC_GAIN.setMaturityDateAbove(null);
			TOP_OPEN_PERC_GAIN.setMaturityDateBelow(null);
			TOP_OPEN_PERC_GAIN.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_OPEN_PERC_GAIN.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_OPEN_PERC_GAIN.setExcludeConvertible("0");
			TOP_OPEN_PERC_GAIN.setScannerSettingPairs("Annual,true");
			TOP_OPEN_PERC_GAIN.setStockTypeFilter("ALL");
		}
		return TOP_OPEN_PERC_GAIN;
	}
	/**
	 * this returns contracts with the highest percent price DECREASE between the last trade and opening prices.
	 * @return
	 */
	public ScanCriteria getTOP_OPEN_PERC_LOSE_Criteria(){
		if(TOP_OPEN_PERC_LOSE==null){
			TOP_OPEN_PERC_LOSE=new ScanCriteria();
			TOP_OPEN_PERC_LOSE.setNumberOfRows(ROWS_PER_SCAN);
			TOP_OPEN_PERC_LOSE.setVendor("IB");
			TOP_OPEN_PERC_LOSE.setInstrument("STK");
			TOP_OPEN_PERC_LOSE.setLocationCode(LOCATION_CODE);
			TOP_OPEN_PERC_LOSE.setScanCode(IBScanCode.TOP_OPEN_PERC_LOSE.name());
			TOP_OPEN_PERC_LOSE.setAbovePrice(ABOVE_PRICE);
			TOP_OPEN_PERC_LOSE.setBelowPrice(BELOW_PRICE);
			TOP_OPEN_PERC_LOSE.setAboveVolume(ABOVE_VOLUME);
			TOP_OPEN_PERC_LOSE.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			TOP_OPEN_PERC_LOSE.setMarketCapAbove(MARKET_CAP_ABOVE);
			TOP_OPEN_PERC_LOSE.setMarketCapBelow(ScanCriteria.NOT_SET);
			TOP_OPEN_PERC_LOSE.setMoodyRatingAbove("");
			TOP_OPEN_PERC_LOSE.setMoodyRatingBelow("");
			TOP_OPEN_PERC_LOSE.setSpRatingAbove("");
			TOP_OPEN_PERC_LOSE.setSpRatingBelow("");
			TOP_OPEN_PERC_LOSE.setMaturityDateAbove(null);
			TOP_OPEN_PERC_LOSE.setMaturityDateBelow(null);
			TOP_OPEN_PERC_LOSE.setCouponRateAbove(ScanCriteria.NOT_SET);
			TOP_OPEN_PERC_LOSE.setCouponRateBelow(ScanCriteria.NOT_SET);
			TOP_OPEN_PERC_LOSE.setExcludeConvertible("0");
			TOP_OPEN_PERC_LOSE.setScannerSettingPairs("Annual,true");
			TOP_OPEN_PERC_LOSE.setStockTypeFilter("ALL");
		}
		return TOP_OPEN_PERC_LOSE;
	}
	/**
	 * this returns contracts with the highest percent price INCREASE between the previous close and today's opening prices.
	 * @return
	 */
	public ScanCriteria getHIGH_OPEN_GAP_Criteria(){
		if(HIGH_OPEN_GAP==null){
			HIGH_OPEN_GAP=new ScanCriteria();
			HIGH_OPEN_GAP.setNumberOfRows(ROWS_PER_SCAN);
			HIGH_OPEN_GAP.setVendor("IB");
			HIGH_OPEN_GAP.setInstrument("STK");
			HIGH_OPEN_GAP.setLocationCode(LOCATION_CODE);
			HIGH_OPEN_GAP.setScanCode(IBScanCode.HIGH_OPEN_GAP.name());
			HIGH_OPEN_GAP.setAbovePrice(ABOVE_PRICE);
			HIGH_OPEN_GAP.setBelowPrice(BELOW_PRICE);
			HIGH_OPEN_GAP.setAboveVolume(ABOVE_VOLUME);
			HIGH_OPEN_GAP.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HIGH_OPEN_GAP.setMarketCapAbove(MARKET_CAP_ABOVE);
			HIGH_OPEN_GAP.setMarketCapBelow(ScanCriteria.NOT_SET);
			HIGH_OPEN_GAP.setMoodyRatingAbove("");
			HIGH_OPEN_GAP.setMoodyRatingBelow("");
			HIGH_OPEN_GAP.setSpRatingAbove("");
			HIGH_OPEN_GAP.setSpRatingBelow("");
			HIGH_OPEN_GAP.setMaturityDateAbove(null);
			HIGH_OPEN_GAP.setMaturityDateBelow(null);
			HIGH_OPEN_GAP.setCouponRateAbove(ScanCriteria.NOT_SET);
			HIGH_OPEN_GAP.setCouponRateBelow(ScanCriteria.NOT_SET);
			HIGH_OPEN_GAP.setExcludeConvertible("0");
			HIGH_OPEN_GAP.setScannerSettingPairs("Annual,true");
			HIGH_OPEN_GAP.setStockTypeFilter("ALL");
		}
		return HIGH_OPEN_GAP;
	}
	/**
	 * this returns contracts with the highest percent price DECREASE between the previous close and today's opening prices.
	 * @return
	 */
	public ScanCriteria getLOW_OPEN_GAP_Criteria(){
		if(LOW_OPEN_GAP==null){
			LOW_OPEN_GAP=new ScanCriteria();
			LOW_OPEN_GAP.setNumberOfRows(ROWS_PER_SCAN);
			LOW_OPEN_GAP.setVendor("IB");
			LOW_OPEN_GAP.setInstrument("STK");
			LOW_OPEN_GAP.setLocationCode(LOCATION_CODE);
			LOW_OPEN_GAP.setScanCode(IBScanCode.LOW_OPEN_GAP.name());
			LOW_OPEN_GAP.setAbovePrice(ABOVE_PRICE);
			LOW_OPEN_GAP.setBelowPrice(BELOW_PRICE);
			LOW_OPEN_GAP.setAboveVolume(ABOVE_VOLUME);
			LOW_OPEN_GAP.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			LOW_OPEN_GAP.setMarketCapAbove(MARKET_CAP_ABOVE);
			LOW_OPEN_GAP.setMarketCapBelow(ScanCriteria.NOT_SET);
			LOW_OPEN_GAP.setMoodyRatingAbove("");
			LOW_OPEN_GAP.setMoodyRatingBelow("");
			LOW_OPEN_GAP.setSpRatingAbove("");
			LOW_OPEN_GAP.setSpRatingBelow("");
			LOW_OPEN_GAP.setMaturityDateAbove(null);
			LOW_OPEN_GAP.setMaturityDateBelow(null);
			LOW_OPEN_GAP.setCouponRateAbove(ScanCriteria.NOT_SET);
			LOW_OPEN_GAP.setCouponRateBelow(ScanCriteria.NOT_SET);
			LOW_OPEN_GAP.setExcludeConvertible("0");
			LOW_OPEN_GAP.setScannerSettingPairs("Annual,true");
			LOW_OPEN_GAP.setStockTypeFilter("ALL");
		}
		return LOW_OPEN_GAP;
	}
	/**
	 * this returns the highest synthetic EFP interest rates available. These rates are computed by taking the price differential between the SSF and the underlying stock and netting dividends to calculate an annualized synthetic implied interest rate over the period of the SSF. The High rates may present an investment opportunity.
	 * @return
	 */
	public ScanCriteria getHIGH_SYNTH_BID_REV_NAT_YIELD_Criteria(){
		if(HIGH_SYNTH_BID_REV_NAT_YIELD==null){
			HIGH_SYNTH_BID_REV_NAT_YIELD=new ScanCriteria();
			HIGH_SYNTH_BID_REV_NAT_YIELD.setNumberOfRows(ROWS_PER_SCAN);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setVendor("IB");
			HIGH_SYNTH_BID_REV_NAT_YIELD.setInstrument("STK");
			HIGH_SYNTH_BID_REV_NAT_YIELD.setLocationCode(LOCATION_CODE);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setScanCode(IBScanCode.HIGH_SYNTH_BID_REV_NAT_YIELD.name());
			HIGH_SYNTH_BID_REV_NAT_YIELD.setAbovePrice(ABOVE_PRICE);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setBelowPrice(BELOW_PRICE);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setAboveVolume(ABOVE_VOLUME);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setMarketCapAbove(MARKET_CAP_ABOVE);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setMarketCapBelow(ScanCriteria.NOT_SET);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setMoodyRatingAbove("");
			HIGH_SYNTH_BID_REV_NAT_YIELD.setMoodyRatingBelow("");
			HIGH_SYNTH_BID_REV_NAT_YIELD.setSpRatingAbove("");
			HIGH_SYNTH_BID_REV_NAT_YIELD.setSpRatingBelow("");
			HIGH_SYNTH_BID_REV_NAT_YIELD.setMaturityDateAbove(null);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setMaturityDateBelow(null);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setCouponRateAbove(ScanCriteria.NOT_SET);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setCouponRateBelow(ScanCriteria.NOT_SET);
			HIGH_SYNTH_BID_REV_NAT_YIELD.setExcludeConvertible("0");
			HIGH_SYNTH_BID_REV_NAT_YIELD.setScannerSettingPairs("Annual,true");
			HIGH_SYNTH_BID_REV_NAT_YIELD.setStockTypeFilter("ALL");
		}
		return HIGH_SYNTH_BID_REV_NAT_YIELD;
	}
	/**
	 * this returns the lowest synthetic EFP interest rates available. These rates are computed by taking the price differential between the SSF and the underlying stock and netting dividends to calculate an annualized synthetic implied interest rate over the period of the SSF. The Low rates may present a borrowing opportunity.
	 * @return
	 */
	public ScanCriteria getLOW_SYNTH_BID_REV_NAT_YIELD_Criteria(){
		if(LOW_SYNTH_BID_REV_NAT_YIELD==null){
			LOW_SYNTH_BID_REV_NAT_YIELD=new ScanCriteria();
			LOW_SYNTH_BID_REV_NAT_YIELD.setNumberOfRows(ROWS_PER_SCAN);
			LOW_SYNTH_BID_REV_NAT_YIELD.setVendor("IB");
			LOW_SYNTH_BID_REV_NAT_YIELD.setInstrument("STK");
			LOW_SYNTH_BID_REV_NAT_YIELD.setLocationCode(LOCATION_CODE);
			LOW_SYNTH_BID_REV_NAT_YIELD.setScanCode(IBScanCode.LOW_SYNTH_BID_REV_NAT_YIELD.name());
			LOW_SYNTH_BID_REV_NAT_YIELD.setAbovePrice(ABOVE_PRICE);
			LOW_SYNTH_BID_REV_NAT_YIELD.setBelowPrice(BELOW_PRICE);
			LOW_SYNTH_BID_REV_NAT_YIELD.setAboveVolume(ABOVE_VOLUME);
			LOW_SYNTH_BID_REV_NAT_YIELD.setAverageOptionVolumeAbove(AVERAGE_OPTION_VOLUME_ABOVE);
			LOW_SYNTH_BID_REV_NAT_YIELD.setMarketCapAbove(MARKET_CAP_ABOVE);
			LOW_SYNTH_BID_REV_NAT_YIELD.setMarketCapBelow(ScanCriteria.NOT_SET);
			LOW_SYNTH_BID_REV_NAT_YIELD.setMoodyRatingAbove("");
			LOW_SYNTH_BID_REV_NAT_YIELD.setMoodyRatingBelow("");
			LOW_SYNTH_BID_REV_NAT_YIELD.setSpRatingAbove("");
			LOW_SYNTH_BID_REV_NAT_YIELD.setSpRatingBelow("");
			LOW_SYNTH_BID_REV_NAT_YIELD.setMaturityDateAbove(null);
			LOW_SYNTH_BID_REV_NAT_YIELD.setMaturityDateBelow(null);
			LOW_SYNTH_BID_REV_NAT_YIELD.setCouponRateAbove(ScanCriteria.NOT_SET);
			LOW_SYNTH_BID_REV_NAT_YIELD.setCouponRateBelow(ScanCriteria.NOT_SET);
			LOW_SYNTH_BID_REV_NAT_YIELD.setExcludeConvertible("0");
			LOW_SYNTH_BID_REV_NAT_YIELD.setScannerSettingPairs("Annual,true");
			LOW_SYNTH_BID_REV_NAT_YIELD.setStockTypeFilter("ALL");
		}
		return LOW_SYNTH_BID_REV_NAT_YIELD;
	}

}
